<? session_start();
						
include_once ('core/conn.php');
						
$db = get_conn();
						
check_session();
						
if($_GET['id'] != ''){
							
	$sql = " select * from users_options where id_option=".$_GET['id']; 
							
	$result = mysql_query($sql);	
							
	if($result){
								
		$row = mysql_fetch_array($result);
		$id_option = $row['id_option'];
		$name = $row['name'];
							
	}else{
								
		error_handling($sql,mysql_error());
							
	}
						
}
						
						
					
?>
					
					
<html>
					
<head>
					
					

				
				
<script>
					
<!--
						
	function checkdata(obj){
							
						
							
		if(obj.name.value ==''){
								
			alert('Please fill the name');
								
			obj.name.focus();
								
			return false;
							
		}
	return true;
						
	}
					
-->
					
</script>
					
</head>									
					
<body>														
				
				
<form name='users_options' method='post' action='/core/user_options.php' onsubmit='return checkdata(this)'>
  <table width='100%' border='0'>
    <tr>
      <td width="8%" align='left' nowrap> Option Name </td>
      <td width="92%" align='left'><input type='text' name='name' value='<? echo $name;?>'>
        <input type='hidden' name='id_option' value='<? echo $id_option;?>'></td>
    </tr>
    <tr>
      <td colspan='2' align='center'><?
							  
					if ($_GET['id'] != ""){
								
						echo "<input type='submit' name='Actualizar' value='Actualizar'>";
								
						echo "<input type='submit' name='Eliminar' value='Borrar'>";										
								
						echo "<input type='submit' name='Nuevo' value='Cancelar'>";
							  
					}else{
								
						echo "<input type='submit' name='Agregar' value='Agregar'>";
							  
					}
							 
					?></td>
    </tr>
  </table>
</form>
					
</body></html>													
					